package com.mtq.web.department.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mtq.utils.PageModel;
import com.mtq.web.department.dao.IDepartmentDao;

@Service
@Transactional
public class DepartmentService {

	@Autowired
	private IDepartmentDao iDepartmentDao;
	
	public void queryDepartment(PageModel page,String deptName)throws Exception{
		page.setTotalRow(iDepartmentDao.queryDepartmentLength(deptName));
		List<Map<String, Object>> queryDepartment = iDepartmentDao.queryDepartment(deptName, page.getMysqlLimit());
		page.setData(queryDepartment);
	}
}
